package ch07;

public class Coin {	
	public static final double QUARTER_VALUE = 0.25;
	public static final double DIME_VALUE = 0.1;
	public static final double NICLE_VALUE = 0.05;
	public static final double PENNY_VALUE = 0.01;
	public static final double DOLLAR_VALUE = 0.01;
	
	public static final int QUARTER = 1;
	public static final int DIME = 2;
	public static final int NICLE = 3;
	public static final int PENNY = 4;
	public static final int DOLLAR = 5;
	
	private int type;
	
	public Coin(int coinType){
		type = coinType;
	}
	
	public int getType()
	{
		return type;
	}
	
	public double getValue()
	{
		double returnValue;
		switch(type)
		{
		case QUARTER:
			returnValue = QUARTER_VALUE;
			break;
		case DIME:
			returnValue = DIME_VALUE;
			break;
		case NICLE:
			returnValue = NICLE_VALUE;
			break;
		case PENNY:
			returnValue = PENNY_VALUE;
			break;
		case DOLLAR:
			returnValue = DOLLAR_VALUE;
			break;
		default:
			returnValue = 0;
			break;
		}
		return returnValue;
	}

}
